﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WordRacer.Domain.Model.GameCells;

namespace WordRacer.Domain.Tests.Unit.GameCells
{
  public static class GameCellFixture
  {
    /// <summary>
    /// Make sure that both Cells have a listing to each other so they can be found from each other's connection list
    /// </summary>
    /// <param name="uno">cell to be sure connected to dos</param>
    /// <param name="dos">cell to be sure connected to uno</param>
    /// <returns></returns>
    public static Boolean TwoCellsHaveConnectionToEachOther(GameCell uno, GameCell dos)
    {
      Boolean retVal = false; 
      //test first cell lists second cell 
      Boolean leftCheck = false; //assume no connection
      leftCheck = uno.ConnectedCells.Contains(dos);

      //test second cell lists first cell 
      Boolean rightCheck = false; //assume no connection
      rightCheck = dos.ConnectedCells.Contains(uno);

      retVal = leftCheck && rightCheck;
      
      return retVal;
    }
  }
}
